import { Injectable } from '@nestjs/common';
import * as dayjs from 'dayjs'
@Injectable()
export class HomeService {

 

 private  terminalStatus: any = {
    signal_strength: -65,
    frequency: {
      uplink: 2500,
      downlink: 2700,
    },
    snr: 25,
    service_cell: 'Cell-56',
    sim: 'nocard',
    id: 'string',
    '1pps': 'ok',
    tod: 'ok',
    host_registration: 'register',
    position: {
      longitude: 0,
      latitude: 0,
    },
    mcs: {
      up: 0,
      down: 0,
    },
  };

  async apStatus() {
    return {
      code: 200,
      message: 'success',
      data: this.terminalStatus
    };
  }

  async todStatus() {
    function getTodStatusData() {
      return {
        tod_sec: Date.now(),
        tod_usec: Date.now(),
        longitude: -118.2437,
        latitude: 160,
        altitude: 22.01,
        eastward_speed: 22.01,
        northward_speed: 22.01,
        skyward_speed: 22.01,
      };
    }
    return {
      code: 200,
      message: 'success',
      data: {
        info: getTodStatusData(),
      }
    };
  }
}
